#include<bits/stdc++.h>
using namespace std;
int a[100010],e[100010];
int w=0;
priority_queue<int>q;
int jss;
int main(){
    freopen("duel.in","r",stdin);
  freopen("duel.out","w",stdout);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        if(!a[x]){
            w++;
            e[w]=x;
        }
        a[x]++;

    }

    int sum=a[e[1]];
    for(int i=2;i<=w;i++){
        if(a[e[i]]>=sum){jss=jss+sum;
            sum=0;


        }
        else{
            sum-=a[e[i]];
            jss+=a[e[i]];
        }
        sum+=a[e[i]];
    }
    cout<<n-jss;
}
